package com.topisv.tms.service.test;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.topisv.tms.entity.User;
import com.topisv.tms.mybatis.Pagination;
import com.topisv.tms.mybatis.SqlMapDao;
import com.topisv.tms.mybatis.service.CommonService;
import com.topisv.tms.utils.PubUtil;

@Component
@Transactional(readOnly = false)
public class DemoService extends CommonService{
    
    public Pagination getAllUser() {
        Pagination page = this.myBatisPage("test.countQuery", "test.getUserList", null);
        return page;
    }
    
    public List getUserList(User user) {
        List<User> list = PubUtil.convertListMapToObject(sqlMapDao.selectList("test.getUserList", user), User.class);
        return list;
    }
}
